package com.carkeeper.service;

import com.carkeeper.dto.CUserDTO;
import com.carkeeper.dto.UserDTO;
import com.carkeeper.service.serviceFallback.UserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * C端用户-微服务接口
 */
@FeignClient(value = "carkeeper-user", fallbackFactory = UserFallbackFactory.class)
public interface CUserFeign {

    /**
     * 获取C端用户信息
     *
     * @param id C端用户id
     * @return C端用户信息
     */
    @GetMapping("/cuser/{id}")
    CUserDTO findById(@PathVariable(value = "id") Long id);

    /**
     * 获取C端用户列表
     *
     * @param dto 查询条件
     * @return C端用户列表
     */
    @PostMapping("/cuser/list")
    List<CUserDTO> findAll(@RequestBody CUserDTO dto);

}

